{% extends 'base.html' %}

{% block title_suffix %}
    | page tree
{% endblock %}


{% block content %}
<div class="page-header">
	<h1>Page tree <small>Temporary Page Management</small></h1>
</div>
    {% if page %}
		<table class="table table-bordered table-striped table-condensed table-hover">
			<tr>
				<th>Title</th>
				<th>Creator</th>
				<th style="text-align: center;">Edit</th>
				<th style="text-align: center;">Create subpage</th>
				<th style="text-align: center;">Create exercise</th>
				<th style="text-align: center;">Trash</th>
				<th style="text-align: center;">Delete</th>
			</tr>
			{% for page in page %}
			<tr>
				<td><a href="{{ page.get_absolute_url }}">{{ page.title }}</a></td>				
				<td><a href="../auth/user/{{ page.creator }}/">{{ page.creator.first_name }} {{ page.creator.last_name }}</a></td>
				<td style="text-align: center;"><a href="{% url 'page.views.edit' page_id=page.id %}"><i class="icon-edit"></i></a></td>
				<td style="text-align: center;"><a href="{% url 'page.views.create' parent_id=page.id %}"><i class="icon-plus-sign"></i></a></td>
				<td style="text-align: center;"><a href="{% url 'test.views.filter_questions' page_id=page.id %}"><i class="icon-plus-sign"></i></a></td>
				<td style="text-align: center;"><a href="{% url 'page.views.trash_page' page_id=page.id %}"><i class="icon-trash"></i></a></td>
				<td style="text-align: center;"><a href="{% url 'trash.views.delete_page' page_id=page.id %}"><i class="icon-remove"></i></a></td>					
			</tr>
			{% endfor %}
		</table>
    {% else %}
        <p>There are no pages in the database.</p>
    {% endif %}
   
{% endblock %}